import axios from 'axios';

// 发送图文消息
let push = (data) => axios.post('/app/wechat/push', data);

//用户列表
let list = (params) => axios.get('/user/user', { params });

// 获取设置用户分组表单
let set_group = (data) => axios.post('/user/set_group', data);

// 保存用户分组
let save_set_group = (data) => axios.put('/user/save_set_group', data);

// 获取设置用户标签表单
let set_label = (data) => axios.post('/user/set_label', data);

// 保存用户标签
let save_set_label = (data) => axios.put('/user/save_set_label', data);

// 同步用户
let syncUsers = (params) => axios.get('/user/user/syncUsers', { params });

// 添加用户表单
let create = (params) => axios.get('/user/user/create', { params });

// 添加用户
let save = (data) => axios.post('/user/user', data);

// 编辑用户表单
let edit = (params) => axios.get('/user/user/{}/edit', { params });

// 修改用户状态
let user_status = (id, data) => axios.put(`/user/set_status/{}/{}/${id}`, data);

// 编辑用户
let user_edit = (id, data) => axios.put(`/user/user/${id}`, data);

// 用户详情中（积分、消费、签到等信息）
let user_info = (user_id, params) => axios.get(`/user/one_info/${user_id}`, { params });

// 用户详情
let user_detail = (id, params) => axios.get(`/user/user/${id}`, { params });

// 获取编辑其他表单
let form_edit = (params) => axios.get('/user/edit_other/{}', { params });

// 编辑其他
let other_edit = (id, data) => axios.put(`/user/update_other/${id}`, data);

// 赠送付费会员时长表单
let form_time = (uid, params) => axios.get(`/user/give_level_time/${uid}`, { params });

// 执行赠送付费会员
let vip_give = (id, data) => axios.put(`/user/save_give_level_time/${id}`, data);

// 编辑用户
let edit_user = (id, params) => axios.get(`/user/user/user_save_info/${id}`, { params });

export default {
    push,
    list,
    set_group,
    save_set_group,
    set_label,
    save_set_label,
    syncUsers,
    create,
    save,
    edit,
    user_status,
    user_edit,
    user_info,
    user_detail,
    form_edit,
    other_edit,
    form_time,
    vip_give,
    edit_user,
}